package cn.wolfcode.mapper;

import cn.wolfcode.domain.Question;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuestionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Question record);

    Question selectByPrimaryKey(Long id);

    List<Question> selectAll();

    int updateByPrimaryKey(Question record);

    List<Question> selectForList(QueryObject qo);

    //找各类型题目
    List<Question> selectByType(@Param("examId") Long examId, @Param("typeId") Long typeId);

    //随机产生指定数量的题目
    List<Question> selectRandomQuestions(@Param("type") Long type, @Param("num") Integer num);

}